//
//  MStoreGoods.m
//  KYRR
//
//  Created by kuyuZJ on 2017/4/22.
//
//

#import "MStoreGoods.h"

@implementation MStoreGoods

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    if(key){
        if([key isEqualToString: @"shopfoods"]){
            NSArray* array = value;
            if(![WMHelper isNULLOrnil:array]){
                [array enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                    MGoodsType* empty = [[MGoodsType alloc]init];
                    [empty setValuesForKeysWithDictionary:obj];
                    [self.arrayType addObject:empty];
                }];
            }
        }
    }
}

-(NSMutableArray<MGoodsType *> *)arrayType{
    if(!_arrayType){
        _arrayType = [[NSMutableArray alloc]init];
    }
    return _arrayType;
}

@end


@implementation MGoodsType

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    if(key){
        if([key isEqualToString: @"foods"]){
            NSArray* array = value;
            if(![WMHelper isNULLOrnil:array]){
                [array enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                    MGoods* empty = [[MGoods alloc]init];
                    [empty setValuesForKeysWithDictionary:obj];
                    [self.arrayGoods addObject:empty];
                }];
            }
        }
    }
}

-(NSMutableArray<MGoods *> *)arrayGoods{
    if(!_arrayGoods){
        _arrayGoods = [[NSMutableArray alloc]init];
    }
    return _arrayGoods;
}

@end
